package com.wjr.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

/**
 * @Author: wjr
 * @Description: Mysql数据库连接类
 * @Date Created in  2020-09-01 14:33
 * @Modified By:
 */
public class MysqlConnection {
//    static {
//        try {
//            Class.forName("com.mysql.jdbc.Driver");
//        } catch (ClassNotFoundException e) {
//            e.printStackTrace();
//        }
//    }
//    public Statement connectionMysql() throws SQLException {
//        String url = "jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8";
//        String username = "root";
//        String password = "123";
//        Connection conn = null;
//        //建立连接
//        try {
//            conn = DriverManager.getConnection(url, username, password);
//        } catch (SQLException throwables) {
//            throwables.printStackTrace();
//        }
//        return conn.createStatement();
//    }
}
